/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: asus
 * Date: 2025-01-09
 * Time: 17:41
 */
public class IsSubsequence {
    public boolean isSubsequence(String s, String t) {
        int pre = -1;
        int cur = 0;
        for (int i = 0; i < s.length(); i++) {
            char c = s.charAt(i);
            cur = t.indexOf(c);
            if (cur < pre) {
                return false;
            }
            pre = cur;
        }
        return true;
    }
}
